package cn.ruituo.adv2;

import java.io.Serializable;

public class Student implements Serializable {
    private static final long serialVersionUID =1L;
    private String name;
    private transient int age;
    private Sex sex;//

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Sex getSex() {
        return sex;
    }

    public void setSex(Sex sex) {
        this.sex = sex;
    }
    //private String sex;
    //
//    public void setSex(String s){
//        if(s.equals("男")||s.equals("女")){
//            this.sex=s;
//        }
//        throw new IllegalArgumentException("参数错误");
//    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }
}
